package im.starchat.chat.rest.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by liuchao on 3/10/16.
 */
public class UserBean implements Parcelable {

    private String tsig;
    private boolean new_user;
    private String id;
    private String authentication_token;
    private String nickname;
    private String avatar;
    private String description;
    private String gender;
    private String gender_text;
    private String address;
    private String user_type;
    private String user_type_text;
    private String created_at;
    private int followers_count;
    private int followings_count;
    private int rooms_count;
    private int total_popularity;
    private boolean is_following = false;
    private boolean is_followed = false;
    private AccountBean account;


    public String getTsig() {
        return tsig;
    }

    public void setTsig(String tsig) {
        this.tsig = tsig;
    }

    public boolean isNew_user() {
        return new_user;
    }

    public void setNew_user(boolean new_user) {
        this.new_user = new_user;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAuthentication_token() {
        return authentication_token;
    }

    public void setAuthentication_token(String authentication_token) {
        this.authentication_token = authentication_token;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getGender_text() {
        return gender_text;
    }

    public void setGender_text(String gender_text) {
        this.gender_text = gender_text;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUser_type() {
        return user_type;
    }

    public void setUser_type(String user_type) {
        this.user_type = user_type;
    }

    public String getUser_type_text() {
        return user_type_text;
    }

    public void setUser_type_text(String user_type_text) {
        this.user_type_text = user_type_text;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public int getFollowers_count() {
        return followers_count;
    }

    public void setFollowers_count(int followers_count) {
        this.followers_count = followers_count;
    }

    public AccountBean getAccount() {
        return account;
    }

    public void setAccount(AccountBean account) {
        this.account = account;
    }

    public boolean is_following() {
        return is_following;
    }

    public void setIs_following(boolean is_following) {
        this.is_following = is_following;
    }

    public int getRooms_count() {
        return rooms_count;
    }

    public void setRooms_count(int rooms_count) {
        this.rooms_count = rooms_count;
    }

    public int getTotal_popularity() {
        return total_popularity;
    }

    public void setTotal_popularity(int total_popularity) {
        this.total_popularity = total_popularity;
    }

    public int getFollowings_count() {
        return followings_count;
    }

    public void setFollowings_count(int followings_count) {
        this.followings_count = followings_count;
    }

    public boolean is_followed() {
        return is_followed;
    }

    public void setIs_followed(boolean is_followed) {
        this.is_followed = is_followed;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.tsig);
        dest.writeByte(new_user ? (byte) 1 : (byte) 0);
        dest.writeString(this.id);
        dest.writeString(this.authentication_token);
        dest.writeString(this.nickname);
        dest.writeString(this.avatar);
        dest.writeString(this.description);
        dest.writeString(this.gender);
        dest.writeString(this.gender_text);
        dest.writeString(this.address);
        dest.writeString(this.user_type);
        dest.writeString(this.user_type_text);
        dest.writeString(this.created_at);
        dest.writeInt(this.followers_count);
        dest.writeInt(this.followings_count);
        dest.writeInt(this.rooms_count);
        dest.writeInt(this.total_popularity);
        dest.writeByte(is_following ? (byte) 1 : (byte) 0);
        dest.writeByte(is_followed ? (byte) 1 : (byte) 0);
        dest.writeParcelable(this.account, 0);
    }

    public UserBean() {
    }

    protected UserBean(Parcel in) {
        this.tsig = in.readString();
        this.new_user = in.readByte() != 0;
        this.id = in.readString();
        this.authentication_token = in.readString();
        this.nickname = in.readString();
        this.avatar = in.readString();
        this.description = in.readString();
        this.gender = in.readString();
        this.gender_text = in.readString();
        this.address = in.readString();
        this.user_type = in.readString();
        this.user_type_text = in.readString();
        this.created_at = in.readString();
        this.followers_count = in.readInt();
        this.followings_count = in.readInt();
        this.rooms_count = in.readInt();
        this.total_popularity = in.readInt();
        this.is_following = in.readByte() != 0;
        this.is_followed = in.readByte() != 0;
        this.account = in.readParcelable(AccountBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<UserBean> CREATOR = new Parcelable.Creator<UserBean>() {
        public UserBean createFromParcel(Parcel source) {
            return new UserBean(source);
        }

        public UserBean[] newArray(int size) {
            return new UserBean[size];
        }
    };
}
